/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package neuron.file;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import neuron.Network;

/**
 *
 * @author Risto Laakso <risto.laakso@gmail.com>
 */
public class GenericNeuronLoader {
	public static Network load(File f)  throws FileNotFoundException, IOException, ParseException
	{
		if (f.getName().toUpperCase().endsWith(".ASC")) return NeuroLucidaLoader.load(f);
		if (f.getName().toUpperCase().endsWith(".NEURONS")) return NetmorphLoader.load(f);
		throw new IOException("Unrecognized format!");
	}
}
